using System;
using System.Collections.Generic;
using System.Text;

using NHibernate;
using NHibernate.Criterion;

using QLTDK.Entities;
using QLTDK.DataAccess.BaseDaos;
using QLTDK.DataAccess.Interfaces;

namespace QLTDK.DataAccess
{
	public class TdkLoaicbDao : BaseTdkLoaicbDao, ITdkLoaicbDao
    {
        public IList<TdkLoaicb> GetByTenLoaiCB(System.String tenLoaiCB)
        {
            return HibernateTemplate.ExecuteFind<TdkLoaicb>(

                delegate(ISession session)
                {
                    ICriteria criteria = session.CreateCriteria(typeof(TdkLoaicb));

                    criteria.Add(Expression.Eq("TenLoaiCB", tenLoaiCB));

                    return criteria.List<TdkLoaicb>();
                });
        }
	}
}